package com.trhui.mallbook.domain.common;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 接口请求公共参数
 *
 * @author linqy
 */
public class BaseRequest implements Serializable {
    private static final long serialVersionUID = -8130938432046696213L;

    /**
     * 请求订单号 该字段必填
     */
    @JSONField(serialize = false)
    private String merOrderId;

    /**
     * 商户号 该字段必填
     */
    @JSONField(serialize = false)
    private String merchantNo;

    /**
     * 其他拓展信息
     * 
     * 会和 params 合并
     */
    @JSONField(serialize = false)
    private Map<String, Object> extraParams = new HashMap<>();

    public String getMerOrderId() {
        return merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    public String getMerchantNo() {
        return merchantNo;
    }

    public void setMerchantNo(String merchantNo) {
        this.merchantNo = merchantNo;
    }

    public Map<String, Object> getExtraParams() {
        return extraParams;
    }

    /**
     * 添加拓展参数
     * 
     * @param extraParams
     */
    public void addExtraParams(Map<String, Object> extraParams) {
        this.extraParams.putAll(extraParams);
    }

    /**
     * 添加拓展参数
     * 
     * @param key
     * @param value
     */
    public void addExtraParams(String key, Object value) {
        this.extraParams.put(key, value);
    }
}
